home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir36 / alarm13.zip / SAMPLE.ZIP / ASAMPLE.FRM next >
Text File  |  1994-03-14  |  3KB  |  89 lines

  1. VERSION 2.00
  2. Begin Form ASample 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Alarm Sample"
  5.    ClientHeight    =   3630
  6.    ClientLeft      =   2280
  7.    ClientTop       =   2100
  8.    ClientWidth     =   3495
  9.    Height          =   4035
  10.    Icon            =   ASAMPLE.FRX:0000
  11.    Left            =   2220
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   3630
  15.    ScaleWidth      =   3495
  16.    Top             =   1755
  17.    Width           =   3615
  18.    Begin MabryAlarm Alarm1 
  19.       Left            =   120
  20.       Top             =   120
  21.    End
  22.    Begin Label Label2 
  23.       Caption         =   "This is a very simple demonstration of the Alarm custom control.  This program uses the control to update the clock every second with the current time.  It also uses the control to notify the program every 10 seconds (the clock color is changed randomly every 10 seconds).  Lastly, the program uses Alarm to beep every 15 minutes (on the hour, half hour, and quarter hours)."
  24.       Height          =   2415
  25.       Left            =   240
  26.       TabIndex        =   1
  27.       Top             =   960
  28.       Width           =   3015
  29.    End
  30.    Begin Label Label1 
  31.       Alignment       =   2  'Center
  32.       FontBold        =   -1  'True
  33.       FontItalic      =   0   'False
  34.       FontName        =   "MS Sans Serif"
  35.       FontSize        =   17.25
  36.       FontStrikethru  =   0   'False
  37.       FontUnderline   =   0   'False
  38.       Height          =   495
  39.       Left            =   240
  40.       TabIndex        =   0
  41.       Top             =   240
  42.       Width           =   3015
  43.    End
  44. End
  45. Option Explicit
  46.  
  47. Const AT_Second = 0
  48. Const AT_Hour = 1
  49. Const AT_Minute15 = 2
  50. Const AT_HalfHour = 3
  51. Const AT_Minute45 = 4
  52. Const AT_ColorChange = 10
  53.  
  54. Sub Alarm1_Alarm (AlarmIndex As Long, TimeNow As String)
  55.     Label1.Caption = TimeNow
  56.  
  57.     Select Case AlarmIndex
  58.         Case AT_Hour        ' beep three times on the hour
  59.             Beep
  60.             Beep
  61.             Beep
  62.         Case AT_Minute15    ' once on the quarter hour
  63.             Beep
  64.         Case AT_HalfHour    ' twice on the half hour
  65.             Beep
  66.             Beep
  67.         Case AT_Minute45    ' once on the quarter hour
  68.             Beep
  69.  
  70.         Case AT_ColorChange ' change colors every 10 seconds
  71.                             ' definitely ugly (random color)
  72.             Label1.ForeColor = Rnd * &H1000000
  73.     End Select
  74. End Sub
  75.  
  76. Sub Form_Load ()
  77.     ASample.Left = (Screen.Width - ASample.Width) / 2
  78.     ASample.Top = (Screen.Height - ASample.Height) / 2
  79.  
  80.     Alarm1.AlarmTime(AT_Second) = "??:??:??"
  81.     Alarm1.AlarmTime(AT_Hour) = "??:00:00"
  82.     Alarm1.AlarmTime(AT_Minute15) = "??:15:00"
  83.     Alarm1.AlarmTime(AT_HalfHour) = "??:30:00"
  84.     Alarm1.AlarmTime(AT_Minute45) = "??:45:00"
  85.  
  86.     Alarm1.AlarmTime(AT_ColorChange) = "??:??:?0"
  87. End Sub
  88.  
  89.